package tech.dongliang.common.response;

import lombok.Data;
import tech.dongliang.common.error.CommonError;

@Data
public class ErrorData implements CommonError {
    private String errMsg;
    private Integer errCode;

    public ErrorData(CommonError commonError) {
        this.errCode = commonError.getErrCode();
        this.errMsg = commonError.getErrMsg();
    }

    public ErrorData(CommonError commonError, String errMsg) {
        this.errCode = commonError.getErrCode();
        this.errMsg = commonError.getErrMsg();
    }

    @Override
    public CommonError setErrMsg(String errMsg) {
        this.errMsg = errMsg;
        return this;
    }
}
